const FirendLinkModel = require('../do/models/firendlink');
class FirendService{
    async getFirendLink(id){
        if(!id){
            return await FirendLinkModel.findAll({'order':[['createdAt','DESC']]});
        }
        return await FirendLinkModel.findOne({
            where:{
                id
            }
        })
    }
    async createFirendLink(data){
        return await FirendLinkModel.create(data);
    }
    async destroyFirendLink(id){
        return await FirendLinkModel.destroy({
            where:{id}
        })
    }
    async updateFirendLink(id,data){
        return await FirendLinkModel.update(data,{where:{id}})
    }
}
module.exports = new FirendService();